<?
require("config.php");

$location_status .= "| Edit";
$show_backnav = "menu";
$menuname = NULL;
$menutarget = NULL;

if (NULL!=$action){
   $field = array(
	"code",
	"name", 
	"description",
	"url",
	"idx",
	"status"
	);

   $content = array(
	$Code,
	$Name, 
	$Description,
	$Url,
	$Idx,
	$Status
	);

	$exp = "id=$id";

   myUpdate($table,$field,$content,$exp);


   header("location:" . $rela_path . "share/msg.php?v=3921&parent_id=$parent_id");

   exit();

}else{

  if (!checkRecord($table,$id)){

	header("location:" . $rela_path . "share/msg.php?v=9002");

	exit();
  
  }

}


$Query = "SELECT 
code,
name, 
description,
idx,
status,
url 
FROM $table WHERE id=$id LIMIT 1";

$r=myQuery($Query);

$Code=$r[0][0];
$Name=$r[0][1];
$Description=$r[0][2];
$Idx=$r[0][3];
$Status=$r[0][4];
$Url=$r[0][5];

require($rela_path . "inc/header.php");
require($rela_path . "bin/date.php");

?>



<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="action" type="hidden" value="edit">
<input name="Code" type="hidden" value="<?print($Code)?>">
<input name="parent_id" type="hidden" value="<?print($parent_id)?>">





<table width="95%" border="0" align="center">
  <tr> 
    <td valign="top"> <table border="0" cellspacing="5" cellpadding="1">
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td class="tdheader">Code : </td>
            <td><?print($Code)?></td>
          </tr>
          <tr> 
            <td class="tdheader">Publish :</td>
            <td> 
              <?

$sourceData = array(
  1,
  0,
  );

$sourceLabel = array(
  "Yes",
  "No",
  );
$boxName="Status";

FFPCheckBox("Status",$Status,$sourceData,$sourceLabel);

?>
          </tr>
          <tr> 
            <td class="tdheader">Order : </td>
            <td><input type="text" class="text" name="Idx" size="12" value="<?print($Idx)?>"></td>
          </tr>

          <tr> 
            <td class="tdheader">Url :</td>
            <td><input type="text" class="text" name="Url" size="56" value="<?print($Url)?>"></td>
          </tr>

          <tr> 
            <td class="tdheader">Name :</td>
            <td><input type="text" class="text" name="Name" size="56" value="<?print($Name)?>"></td>
          </tr>
          <tr> 
            <td class="tdheader">Description : </td>
            <td><textarea class="text" name="Description" cols="55" rows="8"><?print($Description)?></textarea></td>
          </tr>
              </table></td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td> <input type="image" src="../../images/bt_cancel.gif" onClick="Redirect('menu.php?id=<?=$parent_id?>',1);return false;"> <input type="image" src="../../images/bt_save.gif">
            </td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>

<br>
<br>
<br>


</form>

<?
require($rela_path . "inc/footer.php");
?>
